# 类名要大写
class Person:
    # 数据属性
    def __init__(self, name, sex, height):
        self.name = name
        self.sex = sex
        self.height = height

    def work(self):
        print(self.name, "在工作")


# 创建对讲
person = Person("佳宁", "女", 165)
person.work()


class Phone(object):
    def __init__(self, brand, price=0, colour=""):
        self.brand = brand
        self.price = price
        self.colour = colour

    def cell_phone(self):
        print(self.brand, "打电话了")


phone = Phone("苹果手机", 1900, "黑色")
phone.cell_phone()


class Car:
    def __init__(self, colour="", price=0):
        self.colour = colour
        self.price = price

    def drive_car(self):
        print(self.price, "的车", self.colour, "的颜色")


car = Car("红色", 90000)
car.drive_car()

list_cat = [Car("白色", 1)]
total_price = 0
for item in list_cat:
    total_price += item.price
print(total_price)


class Employee:
    def __init__(self, eid, did, name, money):
        self.eid = eid
        self.did = did
        self.name = name
        self.money = money

